
import 'package:floor/floor.dart';

///运单 - 属性 关联表

@entity
class CustomerBillAttr{
  @PrimaryKey(autoGenerate: true)
  int? id; //建表的时候，可为空, 就会自动生成可自增的id

  int billId; //运单id

  int productId; //产品id
  String productName; //名称
  String productCode; //code

  int attributeId; //属性id
  String attributeCode; //属性code
  String attributeName; //属性名称
  String attributeValue; //属性值

  DateTime createTime;//创建时间
  DateTime updateTime;//更新时间
  int isDelete = 0; //是否删除，0-未删除，1-删除

  CustomerBillAttr(
  {
    this.id,
    required this.billId,

    required this.productId,
    required this.productName,
    required this.productCode,

    required this.attributeId,
    required this.attributeName,
    required this.attributeCode,
    required this. attributeValue,

    required this.createTime,
    required this.updateTime,
    this.isDelete = 0});

 Map<String, Object> toJson() {
   Map<String, Object> map = {};
   map['id'] = (id ??= -1);
   map['billId'] = billId;

   map['productId'] = productId;
   map['productName'] = productName;
   map['productCode'] = productCode;
   map['attributeId'] = attributeId;
   map['attributeName'] = attributeName;
   map['attributeCode'] = attributeCode;

   map['createTime'] = createTime;
   map['updateTime'] = updateTime;
   map['isDelete'] = isDelete;
   return map;
 }

}